<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/taglib_include.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, target-densitydpi=medium-dpi, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5, user-scalable=no" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<link href="${ctx}/css/layout.css?ver=${layout_css_version}" rel="stylesheet" type="text/css" />
<style type="text/css">
.b-font {
	width: 90%;
	margin: 10pt auto 0px;
}

#s-information {
	height: auto !important;
	height: 120pt;
	min-height: 120pt;
}

#w-bg span img, #total-price img {
	margin: 0pt 1%;
	margin-top: 28pt;
	float: left;
}

@media screen and (max-width: 640px) {
	#total-p {
		margin-right: 1%;
	}
}
</style>
<title>${projectTitle }</title>
</head>
<body>
  <header id="main-top">
     <!-- refer为1表示是从确认订单页面跳转到本页面 -->
     <c:if test="${refer==constant.refer_ordersubmit}">
	    <a href="javascript:void(0);" style="visibility: hidden;">
	      <div id="main-top-left">
	        <img src="${ctx}/images/mui_title_back_btn.png" class="img-2">
	      </div>
	    </a>
     </c:if>
     <!-- refer为2表示是从订单详情页面跳转到本页面 -->
     <c:if test="${refer==constant.refer_orderdetail}">
        <a href="javascript:void(0);" id="back">
          <div id="main-top-left">
            <img src="${ctx}/images/mui_title_back_btn.png" class="img-2">
          </div>
        </a>
     </c:if>
    <div id="main-top-title">添加乘客信息</div>
    <a id="main-top-right" href="javascript:void(0);">
      <img src="${ctx }/images/home_icon.png">
    </a>
  </header>
  <div id="container">
    <div class="f-information">
      <span>班次类型：${cf:schTypeName(result.schType) }</span>
      <span> 班次: ${result.regBusNo} </span>
      <span> 车型: ${result.busTypeName} </span>
    </div>
    <div id="s-information">
      <div id="start-information">
        <span class="b-font">${result.startStationName}</span>  
      </div>
      <div id="d-information">
        <span id="time-information">${result.leaveTime}</span>
        <span id="calendar-information">${result.leaveDate}</span>
      </div>
      <div id="arrive-information">
        <span class="b-font">${result.arriveStationName}</span>
      </div>
    </div>
    <div class="f-information"></div>
    <c:if test="${result.fullTicketNum ne '0'}">
	     <a href="javascript:void(0);">
	      <div id="w-bg">
	        <div class="passenger-information">
	          <span style="width: 30%; display: inline-block; float: left">成人票</span>
	          <span style="width: 30%; display: inline-block; float: left">${result.fullTicketNum}张</span>
              <span class="s-font-14">￥</span>
	          <!-- refer为1表示是从确认订单页面跳转到本页面 -->
	          <c:if test="${refer==constant.refer_ordersubmit}">
	               ${result.orderTickets[0].price}/张
	          </c:if>
	          <!-- refer为2表示是从订单列表页面跳转到本页面 -->
	          <c:if test="${refer==constant.refer_orderdetail}">
                   ${result.price}/张
              </c:if>
	        </div>
	      </div>
	    </a>
    </c:if>
    <c:if test="${result.halfTicketNum ne '0'}">
         <a href="javascript:void(0);">
          <div id="w-bg">
            <div class="passenger-information">
              <span style="width: 30%; display: inline-block; float: left">半价票</span>
              <span style="width: 30%; display: inline-block; float: left">${result.halfTicketNum}张</span>
              <!-- refer为1表示是从确认订单页面跳转到本页面 -->
              <c:if test="${refer==constant.refer_ordersubmit}">
              <span class="s-font-14">￥</span>
                  ${result.orderTickets[0].halfPrice}/张
              </c:if>
              <!-- refer为2表示是从订单列表页面跳转到本页面 -->
              <c:if test="${refer==constant.refer_orderdetail}">
              <span class="s-font-14">￥</span>
                    ${result.halfPrice}/张
              </c:if>
            </div>
          </div>
        </a>
    </c:if>
    <c:if test="${result.freeTicketNum ne '0'}">
         <a href="javascript:void(0);">
          <div id="w-bg">
            <div class="passenger-information">
              <span style="width: 30%; display: inline-block; float: left">免票</span>
              <span style="width: 30%; display: inline-block; float: left">${result.freeTicketNum}张</span>
            </div>
          </div>
        </a>
    </c:if>
    <div id="total-price">
      <span>
        <img src="${ctx}/images/price-icon.png" width="32" height="32">
      </span>

        <span id="total-p">
                                总价
        <span class="s-font-14-2">￥</span>
        <span id="total"></span>
      </span>
    </div>
    <div id="Nticket-tip-1" style="color:#FF4500;">温馨提示：座位已成功锁定，请在10分钟内完成支付，超时系统将取消订单。</div>
     <form action="" method="get" id="form">
      <!-- 隐藏表单 -->
      <input type="hidden" name="schType" value="${result.schType}" id="schType">
      <input type="hidden" name="regBusNo" value="${result.regBusNo}" id="regBusNo">
      <input type="hidden" name="busTypeName" value="${result.busTypeName}" id="busTypeName">
      <input type="hidden" name="startStationName" value="${result.startStationName}" id="startStationName">
      <input type="hidden" name="arriveStationName" value="${result.arriveStationName}" id="arriveStationName">
      <input type="hidden" name="leaveTime" value="${result.leaveTime}" id="leaveTime">
      <input type="hidden" name="leaveDate" value="${result.leaveDate}" id="leaveDate">
      <input type="hidden" name="orderId" value="${result.orderId}" id="orderId">
      <input type="hidden" name="serviceprice" value="${serviceprice}" id="serviceprice">
      <input type="hidden" name="totalprices" value="${totalprices}" id="totalprices">
      <input type="hidden" name="fullTicketNum" value="${result.fullTicketNum}" id="fullTicketNum">
      <input type="hidden" name="halfTicketNum" value="${result.halfTicketNum}" id="halfTicketNum">
      <input type="hidden" name="freeTicketNum" value="${result.freeTicketNum}" id="freeTicketNum">
      <input type="hidden" name="orderpnr" value="${result.orderpnr}" id="orderpnr">
      <input type="hidden" name="startstationId" value="${startstationid}" id="startstationId">
      <input type="hidden" name="hasPrivilege" id="hasPrivilege" value="${hasPrivilege}"/>
      <input type="hidden" name="totalPrivilegeAmount" id="totalPrivilegeAmount" value="${totalPrivilegeAmount}"/>
      <!-- refer为1表示是从确认订单页面跳转到本页面 -->
      <c:if test="${refer==constant.refer_ordersubmit}">
	      <input type="hidden" name="price" value="${result.orderTickets[0].price}" id="price">
	      <input type="hidden" name="halfPrice" value="${result.orderTickets[0].halfPrice}" id="halfPrice">
      </c:if>
      <!-- refer为2表示是从订单详情页面跳转到本页面 -->
      <c:if test="${refer==constant.refer_orderdetail}">
          <input type="hidden" name="price" value="${result.price}" id="price">
          <input type="hidden" name="halfPrice" value="${result.halfPrice}" id="halfPrice">
      </c:if>
    </form>
  </div>
  <div id="big-button">
    <a href="javascript:void(0);">
      <div class="sumbit-1" id="addpassengerinfo">添加乘客</div>
    </a>
  </div>
  <script type="text/javascript" src="${ctx}/js/jquery.min.js?ver=${jquery_min_version}"></script>
  <script type="text/javascript">
      $(function(){
    	  var appVer = "${appVer}";
    	  var const_appver_nc = "${constant.appver_nc}";
    	  var const_appver_ylns = "${constant.appver_ylns}";
    	  var serviceprice = $("#serviceprice").val();
    	  var privilegeAmount = "${constant.privilege_amount}";//优惠金额
    	  var totalPrivilegeAmount ="${totalPrivilegeAmount}";
    	  if(totalPrivilegeAmount != ""){
    		  $("#total").html("${totalprices}");		 
    	  }else{
    		  $("#total").html("${totalprices}");
    	  }
    	  
          $("#addpassengerinfo").bind("click",function(){
           $("#form").attr("action","${ctx}/passenger/list.do").submit();
          });
    	  $("#back").bind("click",function(e){
    		  var orderId = $("#orderId").val();
    		  window.location.href = "${ctx}/order/list.do?ver=${appVer}&pageNow=${pageNow}&starting=" + localStorage.starting + "&startStationId=" + localStorage.startStationId + "&startStationsDisabled=" + localStorage.startStationsDisabled;
    	  });

    	  $("#main-top-right").bind("click", function(){
    		  var link = "${ctx}/trafficline/index.do?ver=${appVer}" + "&startCityId=" + localStorage.startCityId + "&starting=" + localStorage.starting + "&startStationId=" + localStorage.startStationId + "&startStationsDisabled=" + localStorage.startStationsDisabled + "&groupId=" + localStorage.groupId;
    		  if (appVer == const_appver_nc || appVer == const_appver_ylns) {
    			  link = "${ctx}/indexnc/index.do?ver=${appVer}"
    		  }
    		  window.location.href = link;
    	  });
      });
  </script>
</body>
</html>